<?php

/** ?? 运算符 */
//$site = $_GET['site'] ?? '菜鸟教程';
//echo $site;
//echo "</br>";

/** 匿名内部类 */
//include_once "Php7Class.php";
//$app->getLogger()->log("1111");


/** 对象序列化 */
//class MyClass1 {
//    public $obj1prop;
//}
//class MyClass2 {
//    public $obj2prop;
//}
//
//$obj1 = new MyClass1();
//$obj1->obj1prop = 1;
//$obj2 = new MyClass2();
//$obj2->obj2prop = 2;
//
//$serializedObj1 = serialize($obj1);
//$serializedObj2 = serialize($obj2);
//
//var_dump($serializedObj1);
//echo "</br>";
//
//// 默认行为是接收所有类
//// 第二个参数可以忽略
//// 如果 allowed_classes 设置为 false, unserialize 会将所有对象转换为 __PHP_Incomplete_Class 对象
//$data = unserialize($serializedObj1 , ["allowed_classes" => true]);
//
//// 转换所有对象到 __PHP_Incomplete_Class 对象，只允许 MyClass1 和 MyClass2 转换到 __PHP_Incomplete_Class
//$data2 = unserialize($serializedObj2 , ["allowed_classes" => ["MyClass1", "MyClass2"]]);
//
//print($data->obj1prop);echo "</br>";
//print(PHP_EOL);echo "</br>";
//print($data2->obj2prop);echo "</br>";

$testData = "{\"name\":\"sachin\",\"hobbies\":\"sports\",\"birthdate\":\"08\/05\/1974 12:20:03 pm\"}";
echo $testData;